<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <title>清除浮动</title>

    <style>
        .father {
            width: 600px;
            border: 1px solid red;
        }
        .big, .small {
            width: 200px;
            height: 200px;
        }
        .big {
            background-color: aquamarine;
            float: left;
        }
        .small {
            background-color: blue;
            float: left;
        }
        .footer {
            width: 600px;
            height: 20px;
            background-color: brown;
        }

        .clearfix:after {
            /*伪元素是行内元素 正常浏览器清除浮动方法*/
            content: "";
            display: block;
            height: 0;
            clear: both;
            visibility: hidden;
        }

        .clearfix {
            *zoom: 1;
            /*ie6清除浮动的方式 *号只有IE6-IE7执行，其他浏览器不执行*/
        }
    </style>
</head>

<body>
    <div class="father clearfix">
        <div class="big">big</div>
        <div class="small">small</div>
    </div>
    <div class="footer"></div>

</body>

</html>